
<script>
import { h } from 'vue'
export default {
  name: 'XtxBread',
  render ({ $slots }) {
    //   获取默认插槽 处理注释问题
    console.log($slots.default())
    const slot = $slots.default().filter(item => item.type.name === 'XtxBreadItem' || item.type.name === 'Transition')
    // console.log(slot)
    const arr = []
    slot.forEach((item, index) => {
      arr.push(item)
      if (index < slot.length - 1) {
        const i = h('i', { class: 'iconfont icon-angle-right' })
        arr.push(i)
      }
    })
    // h('标签','标签属性','标签内容')
    const box = h('div', { class: 'xtx-bread' }, arr)
    return box
  }

}
</script>

<style  lang='less'>
.xtx-bread{
  display: flex;
  padding: 25px 10px;
  &-item {
    a {
      color: #666;
      transition: all .4s;
      &:hover {
        color: @xtxColor;
      }
    }
  }
  i {
    font-size: 12px;
    margin-left: 5px;
    margin-right: 5px;
    line-height: 22px;
  }
}
</style>
